/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GeneralManager.View;

import SaleManager.View.*;
import data.pojo.Book;
import java.util.Arrays;
import java.util.List;
import java.util.Vector;
import javax.swing.table.DefaultTableModel;


/**
 *
 * @author Kite
 */
public class TableModelFactory {

    public static Vector<String> EQUIVALENT_COLUMN_NAMES = new Vector(Arrays.asList("编号","额度(元)", "每百元最大使用比例", "开始日期", "结束日期","数量"));
    public static Vector<String> DISCOUNT_COLUMN_NAMES = new Vector(Arrays.asList("编号","折扣（十分比）","开始日期", "结束日期","数量"));


    public static DefaultTableModel getEquivalentModel() {
        return new MyTableModel(null, EQUIVALENT_COLUMN_NAMES);
    }
    
    public static DefaultTableModel getDiscountModel() {
        return new MyTableModel(null, DISCOUNT_COLUMN_NAMES);
    }

}
class MyTableModel extends DefaultTableModel {

    public MyTableModel(Vector<Vector<String>> data, Vector<String> columnNames) {
        super(data, columnNames);

    }

    public boolean isCellEditable(int row, int column) {
        return false;
    }

    public boolean getColumnSelectionAllowed() {
        return false;
    }
}
